﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModifyUserId.aspx.cs" Inherits="ZX.WebApp.Crm.Customer.ModifyUserId" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="content">
        <table style="width:100%; margin-top:40px;" class="table1">
            <tr>
                <td colspan="2" style=" text-align:center; font-weight:bold;">
                    修改信息专员
                </td>
            </tr>
            <tr style="height: 30px;">
                <th style="width:35%;">
                    当前信息专员：
                </th>
                <td>
                    <asp:TextBox ID="txtUser" runat="server" Width="60%" ReadOnly="true"></asp:TextBox>
                </td>
            </tr>
            <tr style="height: 30px;">
                <th>
                    修改信息专员：
                </th>
                <td>
                    <input type="hidden" id="UserID" name="UserID" runat="server" />
                    <input id="txtUserID" name="txtUserID" type="text" runat="server" readonly="readonly" value="" style="width:60%;" />
                    <button id="btnUserID" name="V" runat="server" type="button" value="" class="yui-button yui-push-button">
                        选择</button>
                </td>
            </tr>
            <asp:HiddenField ID="hiddenId" runat="server" />
        </table>
    </div>
    </form>
</body>
<script type="text/javascript">
    function Save() {
        var userId = document.getElementById("UserID").value;
        var userName = document.getElementById("txtUserID").value;
        var CustomerId = document.getElementById("hiddenId").value;
        if (userId == "" || userName == "") {
            alert("信息专员不能为空!请选择...");
            return;
        } else {
        var url = "../../Extend/AjaxData/CustomOperating.aspx?action=update&entity=CrmCustomer&id=" + CustomerId + "&userid=" + userId;
            YAHOO.util.Connect.asyncRequest('POST', url, {
                success: function (res) {
                    var inventory;
                    try {
                        inventory = res.responseText;
                        if (inventory == 1) {
                            alert("修改成功!");
                            parent.closeWin();
                        } else {
                            alert(inventory);
                        }
                    }
                    catch (e) {
                    }
                    finally {
                    }
                },
                failure: function (error) {
                    alert("读取数据错误：" + error.statusText);
                }
            }, null);
        }
    }
</script>
</html>
